@echo off

:: Calculate the string length
:: Usage: strlen [string]

SETLOCAL ENABLEDELAYEDEXPANSION
if "%~1" == "" (set string=%0) else (set string=%*)
set MAXSIZE=1000
set count=0
for /l %%a in (0,1,%MAXSIZE%) do (
if NOT "!string:~%%a,1!" == "" (set /a count+=1) else (goto EXIT)
)
echo error happend.&goto :EOF
:EXIT
echo !count!
endlocal
